package org.liulinlin.sejw.db;

import java.sql.*;

public class AllocDetails {//extends DataAccessServiceImpl {
	private int id;
	private Commission commission;
	private int bigNum;
	private int smallNum;
	private int status;
	private String BAFID;
	
	public AllocDetails() {
		
	}
	public AllocDetails(int id) {
		DBConnectionManager connMgr = DBConnectionManager.getInstance();
		Connection con = connMgr.getConnection("shipping_export");
		if (con == null) {
			System.out.println("AllocDetails不能获得数据库连接");
			return;
		}
		
		try {
			Statement stmt = con.createStatement();
			ResultSet rs = stmt.executeQuery("select * from AllocDetails where AD_ID = '" + id + "'");
		
			rs.next();
			this.id = id;
			commission = new Commission(rs.getString("Comm_ID"));
			bigNum = rs.getInt("AD_BigNum");
			smallNum = rs.getInt("AD_SmallNum");
			status = rs.getInt("AD_Status");
			BAFID = rs.getString("BAF_ID");
			
			stmt.close();
			rs.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		connMgr.freeConnection("shipping_export", con);
		connMgr.release();
	}
	
	public void setId(int id) {
		this.id = id;
	}
	public void setCommission(Commission commission) {
		this.commission = commission;
	}
	public void setBigNum(int bigNum) {
		this.bigNum = bigNum;
	}
	public void setSmallNum(int smallNum) {
		this.smallNum = smallNum;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public void setBAFID(String BAFID) {
		this.BAFID = BAFID;
	}
	
	public int getId() {
		return id;
	}
	public Commission getCommission() {
		return commission;
	}
	public int getBigNum(){
		return bigNum;
	}
	public int getSmallNum() {
		return smallNum;
	}
	public int getStatus() {
		return status;
	}
	public String getBAFID() {
		return BAFID;
	}
}
